<template>
  <div class="content">
    <div class="index-header-box" id="head">
      <div class="index-header">
        <div @click="$router.back(-1)" class="back">
          <van-icon name="arrow-left"/>
        </div>
        <div class="title">明细</div>
      </div>
    </div>

    <ul class="invite-list-box">
      <van-list class="list-cell no-border van-clearfix" v-model="loading" :finished="finished"
                finished-text="没有更多了" @load="onLoad">

        <template v-for="item in list">
          <li class="item">
            <div class="item-box">
              <div class="tit">{{item.title}}</div>
              <div class="time">{{item.create_time}}</div>
            </div>
            <div class="item-box cen" :class="{'active':item.status==1?false:true}">
              {{item.status==1?'+':"-"}}{{item.money}}
            </div>
            <div class="item-box right" :class="{'active':item.status==1?false:true}">
              {{item.status==1?'已通过':"未通过审核"}}
            </div>
          </li>
        </template>
      </van-list>
    </ul>

  </div>
</template>

<script>
  export default {
    name: "invite_more",
    components: {},
    data() {
      return {
          page:1,
          type: this.$route.query.type||1,

          list: [],
          loading: false,
          finished: false,
      }
    },
    computed: {},
    mounted: function () {
        console.log(this.type);
    },
    methods: {
        onLoad() {
            var that=this;

            this.$api.member.getRecord(this.page,that.type).then(res=>{
                res=res.data;
                if (res.data.data.length) {
                    that.list.push(...res.data.data);
                    that.page++;

                    that.loading = false;
                } else {
                    that.finished = true;
                }
            });
        },
    },
  }
</script>

<style lang="scss" scoped>
  @import "../../assets/scss/user.scss";
</style>
